package com.cc.visitor.dao;

import com.cc.visitor.entity.Department;
import com.cc.visitor.entity.UserWeixin;
import com.cc.visitor.entity.Visit;
import com.mybatisflex.core.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * @author chanchaw
 * @create 2024-11-20 10:27
 */
@Repository
public interface CallProcedureMapper extends BaseMapper<UserWeixin> {
    // 查询获取厂内员工被访单位的 top3
    @Select("call usp_getVisitorTop3(#{openId})")
    List<Map<String, Object>> getVisitorTop3(@Param("openId") String openId);
    @Select("call usp_getUnFinishedVisit(#{unionId})")
    List<Map<String,Object>> getUnFinishedVisit(@Param("unionId") String unionId);
    @Select("call usp_getVisitorDayRecords(#{unionId},#{targetDay},#{finished})")
    List<Visit> getVisitorDayRecords(@Param("unionId")String unionId, @Param("targetDay")String targetDay, @Param("finished")Integer finished);
    @Select("call usp_getVisitorDayRecords8VisitorName(#{visitorName},#{targetDay},#{finished})")
    List<Visit> getVisitorDayRecords8VisitorName(@Param("visitorName")String visitorName, @Param("targetDay")String targetDay, @Param("finished")Integer finished);
    @Select("call usp_getRejectVisit(#{sdate},#{edate})")
    List<Map<String,Object>> getRejectVisit(@Param("sdate") LocalDate sdate,@Param("edate") LocalDate edate);
}
